-- GENERATED SPELL FOR [Plagued Guardian] --


function spell0_16981(pUnit, Event) --@Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(54890,pUnit)
pUnit:RegisterEvent('Sorts_16981', 1500, 1)
end

function spell1_16981(pUnit, Event) --@Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(54891,pUnit)
pUnit:RegisterEvent('Sorts_16981', 1500, 1)
end

function spell2_16981(pUnit, Event) --@Blink,Self--
pUnit:FullCastSpellOnTarget(29208,pUnit)
pUnit:RegisterEvent('Sorts_16981', 1266, 1)
end

function spell3_16981(pUnit, Event) --@Blink,Self--
pUnit:FullCastSpellOnTarget(29209,pUnit)
pUnit:RegisterEvent('Sorts_16981', 1290, 1)
end

function spell4_16981(pUnit, Event) --@Blink,Self--
pUnit:FullCastSpellOnTarget(29210,pUnit)
pUnit:RegisterEvent('Sorts_16981', 1305, 1)
end

function spell5_16981(pUnit, Event) --@Blink,Self--
pUnit:FullCastSpellOnTarget(29211,pUnit)
pUnit:RegisterEvent('Sorts_16981', 1301, 1)
end

function Sorts_16981(pUnit, Event)
local choix_sorts_16981 = math.random(0, 5)
if choix_sorts_16981 == 0 then
pUnit:RegisterEvent('spell0_16981', 1, 1)
end
if choix_sorts_16981 == 1 then
pUnit:RegisterEvent('spell1_16981', 1, 1)
end
if choix_sorts_16981 == 2 then
pUnit:RegisterEvent('spell2_16981', 1, 1)
end
if choix_sorts_16981 == 3 then
pUnit:RegisterEvent('spell3_16981', 1, 1)
end
if choix_sorts_16981 == 4 then
pUnit:RegisterEvent('spell4_16981', 1, 1)
end
if choix_sorts_16981 == 5 then
pUnit:RegisterEvent('spell5_16981', 1, 1)
end
end

function mob16981_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16981', math.random(1500, 3000), 1)
end

function mob16981_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16981_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16981_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16981, 1, 'mob16981_Action')
RegisterUnitEvent(16981, 2, 'mob16981_Leave')
RegisterUnitEvent(16981, 3, 'mob16981_Kill')
RegisterUnitEvent(16981, 4, 'mob16981_Die')
